package myky.com.doctorapp.adapter

import android.graphics.Color
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import myky.com.doctorapp.R
import myky.com.doctorapp.entity.DoctorEntity

class DoctorVisitedAdapter(visiteda: ArrayList<DoctorEntity.PayLoadEntity.DoctorvisitsEntity>, strings: MutableList<Array<String>>) :
        BaseQuickAdapter<DoctorEntity.PayLoadEntity.DoctorvisitsEntity, BaseViewHolder>(R.layout.visist_time_adapter, visiteda) {


    private var weekinds = strings


    override fun convert(helper: BaseViewHolder, item: DoctorEntity.PayLoadEntity.DoctorvisitsEntity) {
        val position = helper.layoutPosition

        helper.setText(R.id.visit_time_tv1, weekinds[0][position])
        if (position == 0) {

            helper.setText(R.id.visit_time_tv2, "上午")
            helper.setTextColor(R.id.visit_time_tv2, Color.parseColor("#676767"))
            helper.setText(R.id.visit_time_tv3, "下午")
            helper.setTextColor(R.id.visit_time_tv3, Color.parseColor("#676767"))
        } else {
            val visitTime = item.visittime
            if (visitTime == 1) {
                helper.setText(R.id.visit_time_tv2, "出诊")
            } else if (visitTime == 2) {
                helper.setText(R.id.visit_time_tv3, "出诊")
            } else if (visitTime == 3) {
                helper.setText(R.id.visit_time_tv2, "出诊")
                helper.setText(R.id.visit_time_tv3, "出诊")
            }
        }

    }
}